
Deface::Override.new(:virtual_path => 'spree/shared/_main_nav_bar',
                     :name => 'add_taxon_to_main_nav_bar',
                     :insert_after => "li#home-link",) do
  <<HERE
  <% brand_taxon = brand_root_taxon  %>
    <li role="presentation" class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
      <%= brand_taxon.try(:name) %><span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <% brand_taxon.children.each do |taxon| %>
        <li><%= image_tag(taxon.icon.url(:normal)) %><%= link_to taxon.name, seo_url(taxon) %></li>
      <% end %>
    </ul>
  </li>
  <% theme_taxon = theme_root_taxon  %>
  <li role="presentation" class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
      <%= theme_taxon.try(:name) %><span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <% theme_taxon.children.each do |taxon| %>
          <li><%= image_tag(taxon.icon.url(:normal)) %><%= link_to taxon.name, seo_url(taxon) %></li>
      <% end %>
    </ul>
  </li>
HERE
end